import request from '@/utils/request'

export function listGoods(query) {
  return request({
    url: '/mms/v1/goods/list',
    method: 'get',
    params: query
  })
}

export function deleteGoods(data) {
  return request({
    url: '/mms/v1/goods/delete',
    method: 'post',
    data
  })
}

export function publishGoods(data) {
  return request({
    url: '/mms/v1/goods/save',
    method: 'post',
    data
  })
}

export function detailGoods(id) {
  return request({
    url: `/mms/v1/goods/detail/${id}`,
    method: 'get'
  })
}

export function editGoods(data) {
  return request({
    url: '/goods/update',
    method: 'post',
    data
  })
}
export function upGoods(goodsId) {
  return request({
    url: `/mms/v1/goods/publish/${goodsId}`,
    method: 'put'
  })
}
export function downGoods(goodsId) {
  return request({
    url: `/mms/v1/goods/close/${goodsId}`,
    method: 'put'
  })
}
